from django.db import models

# Create your models here.
from tinymce.models import HTMLField
from tinymce import models as tinymce_models


class NewsCategory(models.Model):
    name = models.CharField(max_length=255)
    create = models.DateTimeField(auto_created=True)

class News(models.Model):
    STATUS = (
        ('1','Active'),
        ('0','Deactivate'),
    )
    title = models.CharField(max_length=500)
    create_date = models.DateTimeField(auto_now_add=True)
    category = models.ForeignKey(NewsCategory)
    status = models.CharField(max_length=2,choices=STATUS,default=1)
    body = tinymce_models.HTMLField()

